package com.xiaobias.MyNull;

public class INullPointerDemo {

    public static void main(String[] args) {
        Department department = new Department(null);
        Employee employee = new Employee(department);
        System.out.println(employee.department.company.name);
    }

    private record Company(String name) {}

    private record Department(Company company) {}

    private record Employee(Department department) {}
}
